import '@/styles/index.scss'

import type { App } from 'vue'

import pkg from '../package.json'
import { setupComponents } from './components/setup'
import router from './router'
import { setupStore } from './stores'
import { blankTime } from './utils'
import LoggerUtils from './utils/logger'

import i18n from './locales'
async function bootstrap(app: App) {
  app.use(i18n)
  // 注册路由
  app.use(router)

  // 状态管理
  setupStore(app)

  // 注册全局组件
  setupComponents(app)

  // 挂载
  app.mount('#app')

  LoggerUtils.version(
    `\CDN USER For Web \n\nversion: ${pkg.version}\nenv: ${
      import.meta.env.MODE
    }\nBlank Time: ${blankTime()}\n`
  )
}
export default bootstrap
